package com.iot08.admin.controller;

import com.iot08.admin.controller.base.BaseController;
import com.iot08.admin.service.DeviceLocationService;
import com.iot08.common.response.Response;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * @version 1.0
 * @author: Rock
 * @Description: 渠道管理模块控制器
 * @time: 2020/8/13 18:42
 */
@Controller
@RequestMapping("deviceLocation")
public class DeviceLocationController extends BaseController {

    @Resource
    private DeviceLocationService deviceLocationService;

    /**
     * @Description: 渠道列表
     * @time: 2020/8/14 9:50
     * @author: Rock
     * @version 1.0
     */
    @ResponseBody
    @RequestMapping("list")
    public Response<Object> list(String imei, String startTime, String endTime) {
        return deviceLocationService.list(imei, startTime, endTime, this.getSessionUser());
    }

    /**
     * @Description: 添加页面
     * @time: 2020/8/17 17:21
     * @author: Rock
     * @version 1.0
     */
    @RequestMapping("page")
    public ModelAndView toAdd() {
        ModelAndView mv = new ModelAndView();
        mv.setViewName("device/device_location");
        mv.addObject("lon", 116.397428);
        mv.addObject("lat", 39.90923);
        return mv;

    }

}
